window.addEventListener('message', function(event) {
  if (event.data.type === 'login') {
    // 存储登录状态信息
    localStorage.setItem('isLoggedIn', event.data.data.isLoggedIn);
    localStorage.setItem('token', event.data.data.token);
  }
});